package com.sui.bigdata.rtcadmin.product;

import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.fastjson.JSONObject;
import com.feidee.fdcommon.model.StringResponse;
import com.feidee.fdcommon.util.HttpUtil;
import org.apache.http.client.methods.HttpGet;

/**
 * @author YongChen
 * @date 2020/1/10 14:24
 * @description
 * @email yong_chen@sui.com
 */
public class getSql {

    public static void main(String[] args) throws Exception {


        String url = "http://adam.feidee.com/rtc-admin/jobConfig/anti_fraud_model_portrait_tags";
        StringResponse response = HttpUtil.get(url);
        System.out.println(response.getResponseBody());
        String sql = JSONObject.parseObject(response.getResponseBody()).getString("execSql");
        String str = SQLUtils.formatMySql(sql);
        System.out.println(new String(str.getBytes("ISO8859_1"),"UTF-8"));


    }

}
